package com.yunbiao.ybbusstopplate.base;


import com.yunbiao.ybbusstopplate.utils.net.ResourceUpdate;

public class Constants {

    public final static String XMPP_URL = "www.yunbiao.tv";
    public final static String XMPP_PORT = "5222";
    public final static Integer YBWEB = 1, TESTWEB = 2,LOCAL_SERVER = 3;

    //当前的服务器类型
    public static int CURRENT_SERVER_TYPE = YBWEB;
    /**
     * 资源url web
     */
    public static String RESOURCE_URL = "http://www.yunbiaowulian.com/";
    /**
     * APP版本
     */
    public static String VERSION_BASE_URL=RESOURCE_URL;
    /**
     * 日志上传
     */
    public static String UP_LOAD_ERR_FILE = RESOURCE_URL + "queue/upLoadText.html";

    /**
     * 厂商类型
     */
//    public static String MANUFACTOR_TYPE="2";//1:互视达  2：其他厂商

    /**
     * 中部广告 对应 imagePlayType = 1
     */
    public static int IS_CENTER_ADVERT = 0;

    /**
     * 底部广告 对应 imagePlayType = 2
     */
    public static int IS_BOTTOM_ADVERT = 2;

    /**
     * online中部广告播放 资源路径
     */
//    public static String advertCenterResourcePath = "/storage/emulated/0/guideBoardAPP/resource/advertCenter/";

    /**
     * online底部广告播放 资源路径
     */
//    public static String advertBottomResourcePath = "/storage/emulated/0/guideBoardAPP/resource/advertBottom/";


    /**
     * 本地 中部广告 资源路径
     */
//    public static String advertLocalCenterResourcePath = "/storage/emulated/0/guideBoardAPP/resource/advertLocalCenter/";

    /**
     * 本地 中部广告 资源路径
     */
//    public static String advertLocalBottomResourcePath = "/storage/emulated/0/guideBoardAPP/resource/advertLocalBottom/";

    /**
     * apk 路径
     */
//    public static String apkPath = "/storage/emulated/0/guideBoardAPP/resource/apks/";

    static {
        initConstants(YBWEB);
//        initConstants(TESTWEB);
    }

    public static void initConstants(Integer type) {
        if (type == 1) {
            initYBWebConstants();
        } else if (type == 2) {
            initTestWebConstants();
        }
        CURRENT_SERVER_TYPE = type;
        UP_LOAD_ERR_FILE = RESOURCE_URL + "queue/upLoadText.html";
    }

    public static void initYBWebConstants() {
        RESOURCE_URL="http://test.yunbiao.tv/";
        //初始化为ip，防止域名更改无法升级
        VERSION_BASE_URL="http://182.92.148.106/";

    }

    public static void initTestWebConstants() {
//        RESOURCE_URL="http://test.yunbiao.tv:8855/ybfour/";
//        RESOURCE_URL="http://test.yunbiao.tv:8088/ybfour/";
//        RESOURCE_URL="http://10.0.152.39:8855/yb/";
//        RESOURCE_URL="http://adr.zlmlt.com/yb/";
        RESOURCE_URL="http://test.yunbiao.tv:8085/yb/";
//        RESOURCE_URL="http://ggj.zlmlt.com/";
//        RESOURCE_URL="http://test.yunbiao.tv:8089/yb/";
//        RESOURCE_URL="http://test.yunbiao.tv:8088/dwc/";
//        RESOURCE_URL="http://192.168.31.22:8855/yb/";
//        RESOURCE_URL="http://101.37.32.101:8855/yb/";
        VERSION_BASE_URL=RESOURCE_URL;

    }

    public static void initConstant(String ip, String port) {
        CURRENT_SERVER_TYPE = LOCAL_SERVER;
        RESOURCE_URL = "http://" + ip.trim() + ":" + port.trim() + "/";
        ResourceUpdate.initWebConnect();
    }

    public static void initYbConstant() {
        RESOURCE_URL = "http://www.yunbiaowulian.com/";
        ResourceUpdate.initWebConnect();
    }

}


